from docx import Document
from docx.shared import Pt, RGBColor

document = Document('仕铭推荐.docx')
for paragraph in document.paragraphs:
    print(paragraph.text)
    if '姓名' in paragraph.text:
        paragraph.text = paragraph.text.replace('姓名', '杨洋')
        run = paragraph.runs[0]
        # run = paragraph.add_run(paragraph.text)
        run.font.name = 'SimSun'
        run.font.size = Pt(15)


document.save("test.docx")
